Closed Bug 1335324 Opened 8 years ago Closed 8 years ago

dom/svg/SVGPathData.cpp:210:10: warning: taking the max of unsigned zero and a value is always equal to the other value [-Wmax-unsigned-zero]

Categories

(Core :: SVG, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: m_kato, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When using clang 4.0, the following warning occurs. 1:04.31 In file included from /mozilla/objdir-ib/dom/svg/Unified_cpp_dom_svg5.cpp:74: 1:04.31 Warning: -Wmax-unsigned-zero in /mozilla/mozilla-inbound/dom/svg/SVGPathData.cpp: taking the max of unsigned zero and a value is always equal to the other value 1:04.31 /mozilla/mozilla-inbound/dom/svg/SVGPathData.cpp:210:10: warning: taking the max of unsigned zero and a value is always equal to the other value [-Wmax-unsigned-zero] 1:04.31 return std::max(0U, segIndex - 1); // -1 because while loop takes us 1 too far 1:04.31 ^~~~~~~~ ~~ 1:04.31 /mozilla/mozilla-inbound/dom/svg/SVGPathData.cpp:210:10: note: remove call to max function and unsigned zero argument 1:04.31 return std::max(0U, segIndex - 1); // -1 because while loop takes us 1 too far 1:04.31 ^~~~~~~~ ~~~
presumably std::max(1U, segIndex) - 1; is what's really required here.
Assignee: nobody → sledru
Blocks: 1336978
Attachment #8834009 - Flags: review?(peterv)
Comment on attachment 8834009 [details] Bug 1335324 - Fix a -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) https://reviewboard.mozilla.org/r/110120/#review111164
Attachment #8834009 - Flags: review+
Attachment #8834009 - Flags: review?(peterv)
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8598941437bf Fix a -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=jwatt
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Blocks: 1330397
No longer blocks: clang-based-analysis
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: